package megamek.common.actions;

import junit.framework.TestCase;
import megamek.common.Coords;

import org.junit.Before;
import org.junit.Test;

/**
 * Test case for the DisplacementAttackAction class.
 */
public class DisplacementAttackActionTest extends TestCase
{

	/** The displacement attack action. */
	DisplacementAttackAction action;

	/** The coordinates of the attack. */
	Coords coords;



	/**
	 * Sets up the test case.
	 * 
	 * @throws Exception the exception
	 */
	@Before
	public void setUp() throws Exception
	{
		coords = new Coords(2, 3);
		action = new DisplacementAttackAction(1, 1, coords);
	}



	/**
	 * Test method for the DisplacementAttackAction constructor with the
	 * following signature:DisplacementAttackAction(int, int, int, Coords).
	 */
	@Test
	public void testDisplacementAttackAction()
	{
		DisplacementAttackAction disAtt = new DisplacementAttackAction(1, 1, 1,
				coords);
		assertEquals(coords, disAtt.getTargetPos());
	}



	/**
	 * Test method for the getTargetPos() method.
	 */
	@Test
	public void testGetTargetPos()
	{
		assertEquals(coords, action.getTargetPos());
	}



	/**
	 * Test method for the setTargetPos(megamek.common.Coords) method.
	 */
	@Test
	public void testSetTargetPos()
	{
		coords = new Coords(4, 5);
		action.setTargetPos(coords);

		assertEquals(new Coords(4, 5), action.getTargetPos());
	}

}
